<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>管理</title>
    <#assign base=request.contextPath  />
    <base id="base" href="${base}">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${base}/frame/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${base}/frame/css/admin.css">
    <link rel="stylesheet" type="text/css" href="${base}/wxBackstage/icon/iconfont.css"/>
    <script>
        var base =  "${base}";
    </script>
    <link rel="stylesheet" href="${base}/frame/font-awesome-4.7.0/css/font-awesome.min.css">
    <link href="${base}/frame/fontawesome-free-5.11.2-web/css/all.css" rel="stylesheet">
    <script src="${base}/backstage/js/jquery-1.8.3.min.js"></script>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="layui-row layui-col-space15">

                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">快捷方式</div>
                        <div class="layui-card-body">

                            <div   class="layui-carousel layadmin-carousel layadmin-shortcut" id="menuCarousel">
                                <div carousel-item  >
                                    <!--商家管理-->
                                    <ul class="layui-row layui-col-space10 user"  >
                                        <@shiro.hasPermission name="menu:商家审核查看">
                                        <li class="layui-col-xs3">
                                            <a lay-href="${base}/user/user.html">
                                                <i class="fas fa-bug" style="font-size: 30px"></i>
                                                <cite>商家审核查看</cite>
                                            </a>
                                        </li>
                                        </@shiro.hasPermission>
                                        <@shiro.hasPermission name="menu:菜品分类">
                                        <li class="layui-col-xs3">
                                            <a lay-href="${base}/varietyClassification/varietyClassification.html">
                                                <i class="fas fa-bug" style="font-size: 30px"></i>
                                                <cite>菜品分类</cite>
                                            </a>
                                        </li>
                                        </@shiro.hasPermission>
                                        <@shiro.hasPermission name="menu:菜品管理">
                                            <li class="layui-col-xs3">
                                                <a lay-href="${base}/commodity/commodity.html">
                                                    <i class="fas fa-bug" style="font-size: 30px"></i>
                                                    <cite>菜品管理</cite>
                                                </a>
                                            </li>
                                        </@shiro.hasPermission>
                                    </ul>
                                    <!--菜品设置-->
                                    <ul class="layui-row layui-col-space10 attribute"  >
                                        <@shiro.hasPermission name="menu:属性分类管理">
                                            <li class="layui-col-xs3">
                                                <a lay-href="${base}/attributeClassification/attributeClassification.html">
                                                    <i class="fas fa-bug" style="font-size: 30px"></i>
                                                    <cite>属性分类管理</cite>
                                                </a>
                                            </li>
                                        </@shiro.hasPermission>
                                        <@shiro.hasPermission name="menu:属性管理">
                                            <li class="layui-col-xs3">
                                                <a lay-href="${base}/attribute/attribute.html">
                                                    <i class="fas fa-bug" style="font-size: 30px"></i>
                                                    <cite>属性管理</cite>
                                                </a>
                                            </li>
                                        </@shiro.hasPermission>
                                    </ul>
                                    <!--菜品设置-->
                                    <ul class="layui-row layui-col-space10 dataUpdate"  >
                                        <@shiro.hasPermission name="menu:资料设置">
                                            <li class="layui-col-xs3">
                                                <a lay-href="${base}/user/dataUpdate.html">
                                                    <i class="fas fa-bug" style="font-size: 30px"></i>
                                                    <cite>资料设置</cite>
                                                </a>
                                            </li>
                                        </@shiro.hasPermission>
                                    </ul>
                                    <!--桌号设置-->
                                    <ul class="layui-row layui-col-space10 tableNumber"  >
                                        <@shiro.hasPermission name="menu:桌号设置">
                                            <li class="layui-col-xs3">
                                                <a lay-href="${base}/tableNumber/tableNumber.html">
                                                    <i class="fas fa-bug" style="font-size: 30px"></i>
                                                    <cite>桌号设置</cite>
                                                </a>
                                            </li>
                                        </@shiro.hasPermission>
                                    </ul>



                                    <!--如果地方不够   复制上边ul-->
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">待办事项</div>
                        <div class="layui-card-body">

                            <div class="layui-carousel layadmin-carousel layadmin-backlog" id="waitThing">
                                <div carousel-item>
                                    <ul class="layui-row layui-col-space10">
                                        <li class="layui-col-xs6">
                                            <a lay-href="${base}/user/user.html" class="layadmin-backlog-body">
                                                <h3>商家总数</h3>
                                                <p><cite>${userCount}</cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs6">
                                            <a lay-href="app/forum/list.html" class="layadmin-backlog-body">
                                                <h3>待审帖子</h3>
                                                <p><cite>12</cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs6">
                                            <a lay-href="template/goodslist.html" class="layadmin-backlog-body">
                                                <h3>待审商品</h3>
                                                <p><cite>99</cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs6">
                                            <a href="javascript:;" onclick="layer.tips('不跳转', this, {tips: 3});" class="layadmin-backlog-body">
                                                <h3>待发货</h3>
                                                <p><cite>20</cite></p>
                                            </a>
                                        </li>
                                    </ul>
                                    <ul class="layui-row layui-col-space10">
                                        <li class="layui-col-xs6">
                                            <a href="javascript:;" class="layadmin-backlog-body">
                                                <h3>待审友情链接</h3>
                                                <p><cite style="color: #FF5722;">5</cite></p>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">数据概览</div>
                        <div class="layui-card-body">
                            <div id="echar" class="layui-carousel layadmin-carousel layadmin-dataview" data-anim="fade" lay-filter="LAY-index-dataview">
                                <div carousel-item id="abc">
                                    <div><i class="layui-icon layui-icon-loading1 layadmin-loading"></i></div>
<#--                                    <div></div>-->
<#--                                    <div></div>-->
                                </div>
                            </div>

                        </div>
                    </div>
                    <div class="layui-card">
                        <div class="layui-tab layui-tab-brief layadmin-latestData">
                            <ul class="layui-tab-title">
                                <li class="layui-this">今日热搜</li>
                                <li>今日热帖</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <table id="LAY-index-topSearch"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <table id="LAY-index-topCard"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header">程序版本信息：V1.0</div>
                <div class="layui-card-body layui-text">
                    <table class="layui-table">
                        <colgroup>
                            <col width="100">
                            <col>
                        </colgroup>
                        <tbody>
                        <tr>
                            <td>系统</td>
                            <td id="osName">

                            </td>
                        </tr>
                        <tr>
                            <td>架构</td>
                            <td>
                                SpringBoot
                            </td>
                        </tr>
                        <tr>
                            <td>版本</td>
                            <td id="osVersion">

                            </td>
                        </tr>
                        <tr>
                            <td>开发语言</td>
                            <td>
                                Java
                            </td>
                        </tr>
                        <tr>
                            <td>更新记录</td>
                            <td>
                                V1.0.1 优化计划模块，修复BUG，全测。
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="layui-card">
                <div class="layui-card-header">Jvm已用内存状态</div>
                <div class="layui-card-body layadmin-takerates">
                    <div lay-filter="maxMemory" class="layui-progress "  >
                        <div  class="layui-progress-bar  layui-bg-red"  id="maxMemory"   ></div>
                    </div>

                </div>
                <div class="layui-card-header">总已用内存状态</div>
                <div class="layui-card-body layadmin-takerates">
                    <div lay-filter="total" class="layui-progress"   >
                        <div class="layui-progress-bar  layui-bg-red"   id="total"   ></div>
                    </div>
                </div>
            </div>



            <div class="layui-card">
                <div class="layui-card-header">平台动态</div>
                <div class="layui-card-body">
                    <ul class="layui-timeline" id="dynamic">
                        <li class="layui-timeline-item">
                            <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                            <div class="layui-timeline-content layui-text">
                                <h3 class="layui-timeline-title">2019-11-30 13:22:55</h3>
                                <p>asdasdaas</p>
                            </div>
                        </li>
                        <li class="layui-timeline-item">
                            <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                            <div class="layui-timeline-content layui-text">
                                <h3 class="layui-timeline-title">2019-11-30 13:22:55</h3>
                                <p>asdasdaas</p>
                            </div>
                        </li>
                        <li class="layui-timeline-item">
                            <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                            <div class="layui-timeline-content layui-text">
                                <h3 class="layui-timeline-title">2019-11-30 13:22:55</h3>
                                <p>asdasdaas</p>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="layui-card">
                <div class="layui-card-header">
                    更新记录
                    <i class="layui-icon layui-icon-tips" lay-tips="要支持的噢" lay-offset="5"></i>
                </div>
                <div class="layui-card-body layui-text layadmin-text">
                    <p>
                        V1.0.1 优化计划模块，修复BUG，全测。
                    </p>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="${base}/backstage/layui/layui.js?t=1"></script>
<script>
    layui.config({
        base: '${base}/frame/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'console']);
</script>
<script src="${base}/frame/layuiadmin/lib/extend/echarts.js"></script>
<script>
    var admin;
    var carousel;
    var $;
    layui.use(['table', 'util', 'carousel', 'element', 'admin','laydate'], function () {
        carousel = layui.carousel;
        var element = layui.element;
        var laydate = layui.laydate;
        admin = layui.admin;
        $ = layui.$;



        var menu=  carousel.render({
            elem: "#menuCarousel"
            ,width: '100%'
            ,autoplay: false
            ,indicator:"none"
            ,arrow: 'none'
        });
        var waitThing= carousel.render({
            elem: "#waitThing"
            ,width: '100%'
            ,autoplay: false
            ,indicator:"inside"
            ,anim: 'fade'
        });
        var echar= carousel.render({
            elem: "#echar"
            ,width: '100%'
            ,autoplay: false
            ,indicator:"inside"
            ,anim: 'fade'
        });

        $.ajax({
            type: "GET",
            url: "${base}/index/OSINFO",
            success: function (data) {
                $("#osName").text(data.name)
                $("#osArch").text(data.arch)
                $("#osVersion").text(data.version)
                $("#pathSeparator").text(data.pathSeparator)

            }

        });

        $.ajax({
            type: "GET",
            url: "${base}/index/MemoryINFO",
            success: function (data) {
                var usable=data.usable;
                var max=data.max;
                var free=data.free;
                var total=data.total;
                element.init();
                element.progress('maxMemory', parseInt(usable/max*100)+"%");
                element.progress('total', parseInt(free/total*100)+"%");
                element.render('progress');
            }

        });


        $.ajax({
            type: "GET", //提交方式
            url: "${base}/user/selectByTimeCount",//路径
            dataType: "json",
            success: function (data) {
                var ym = ["",];
                var num = ["",];
                for (let i = 0; i < data.length; i++) {
                    ym.push(data[i].time)
                    num.push(data[i].num)
                }

                var echartsApp = [], options = [
                    {
                        title: {
                            text: '统计商家',
                            x: 'center',
                            textStyle: {
                                fontSize: 14
                            }
                        },
                        tooltip: {
                            trigger: 'axis'
                        },
                        legend: {
                            data: ['', '']
                        },
                        xAxis: [{
                            type: 'category',
                            boundaryGap: false,
                            data: ym
                        }],
                        yAxis: [{
                            type: 'value'
                        }],
                        series: [{
                            name: '商家人数',
                            type: 'line',
                            smooth: true,
                            itemStyle: {
                                normal: {
                                    areaStyle: {
                                        type: 'default',
                                        // color:'#009688'
                                    }
                                }
                                },
                            data: num
                        }
                        ]
                    }
                ]
                    , elemDataView = $('#abc').children('div')
                    , renderDataView = function (index) {
                    echartsApp[index] = echarts.init(elemDataView[index], layui.echartsTheme);
                    echartsApp[index].setOption(options[index]);
                    //window.onresize = echartsApp[index].resize;
                    admin.resize(function () {
                        echartsApp[index].resize();
                    });
                };
                //没找到DOM，终止执行
                if (!elemDataView[0]) return;
                renderDataView(0);
                //监听数据概览轮播
                var carouselIndex = 0;
                carousel.on('change(abc)', function (obj) {
                    renderDataView(carouselIndex = obj.index);
                });
            }
        });
    });
</script>
</body>
</html>